package top.fullj.fsm;

import com.google.common.base.Preconditions;

/**
 * @author bruce.wu
 * @since 2021/8/2 10:39
 */
public class Event {

    private final String name;

    public Event(String name) {
        Preconditions.checkNotNull(name);
        this.name = name;
    }

    @Override
    public int hashCode() {
        return name.hashCode();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Event event = (Event) o;
        return name.equals(event.name);
    }

    @Override
    public String toString() {
        return name;
    }

/*
    void before(StateMachine fsm) {}

    void after(StateMachine fsm) {}

    void cancel(StateMachine fsm) {}
*/

}
